const {
    Random
  } = require("mockjs")
  const Mock = require("mockjs")
 
  const ChatList = require("../model/ChatList")
  
  
  //创建数据的函数
  async function ChatlistData() {
    //酒店列表数据
    const {
      ChatlistMap
    } = Mock.mock({
      "ChatlistMap|10": [{
        'userAId|1': ['6464d7dc9678fde2fc1a2373', '6464d7dc9678fde2fc1a2375','6464d7dc9678fde2fc1a2376','6464d7dc9678fde2fc1a2378','6464d7dc9678fde2fc1a2379','6464d7dc9678fde2fc1a237a'],
        'userBId|1': ['6464d7dd29bc1434b585664c','6464d7dd29bc1434b585664d','6464d7dd29bc1434b585664e','6464d7dd29bc1434b585664f','6464d7dd29bc1434b5856650'],
        'chatRecordA|1': [
          [{A:'你好'},{A:"有房吗"},{B:'有的，想要什么类型呢'}],
          [{A:'你好'},{B:"hi"},{A:"有房吗"},{B:'有的，想要什么类型呢'}],
        ]
      }]
    })
    const res = await Promise.all(
      ChatlistMap.map((item) => {
        // console.log(item);
        return ChatList.create(item)
      })
    )
  }
  
  
  module.exports = ChatlistData